<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src ="js/jquery-3.3.1.js" ></script>
  <style>
      #box{
          background-color: blue;
          width: 1000px;
          height: 1000px;
          text-align: center;
          margin:0 auto;
      }
  </style>
</head>
<body>
<div id = "box" onmousemove="over()" onmouseout="out()"></div>
<script>
    setInterval(changeColor,1);

        var i = 0;
    function changeColor() {
        if (i % 2 == 0) {
            var box = document.getElementById("box");
            box.style.backgroundColor = "red";

        } else {
            var box = document.getElementById("box");
            box.style.backgroundColor = "blue";


        }
        i++;
    }
   /* function over(){
        var box = document.getElementById("box");
        box.style.backgroundColor = "red";
    }
    function out(){
        var box = document.getElementById("box");
        box.style.backgroundColor = "blue";
    }*/
</script>


</body>
</html>